<?php

function getCategoryCount($catID) {
    
}

function get_category_path_slug($slug) {
    $cat_path = array();
    $result = categories::newInstance()->findBySlug($slug);

    if ($result) {
        $cat_path[] = $result[0];
        $parent_id = $result[0]['parent_id'];
        while ($parent_id != 0) {

            $result = categories::newInstance()->findByID($parent_id);
            //print_r($result[0]);
            if (!$result) {
                break;
            }
            $cat_path[] = $result[0];

            $parent_id = $result[0]['parent_id'];
        }
    }


    return $cat_path;
}

function get_category_parent($slug) {
    $result = categories::newInstance()->find(array('slug' => $slug));
    if ($result) {
        return $result[0]['parent_id'];
    }
}
